x86: move trampoline location
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Feb 2010 09:20:56 +0000 (09:20 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Feb 2010 09:20:56 +0000 (09:20 +0000)
A partner of ours is reporting boot failures (Xen not even emitting a
single message) over iSCSI on new (UEFI based) systems. After
pointing at their BIOS initially I finally remembered to take a look
at the memory map a native kernel booted this way see - and voila, the
BIOS reports memory starting at 0x8d000 as reserved. Xen, however,
places about 12k of (trampoline) data at 0x8c000.

For now, move the trampolien down by 4kB to 0x88000. Later we may
choose the location dynamically based on E820 information, if this
proves to be an ongoing problem.

One thing this patch enforces in any case is a single point of
definition for the hard coded location, so that at least adjusting it
won't require more than a single line change in the future.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/boot/Makefile
xen/arch/x86/boot/build32.mk
xen/include/asm-x86/config.h

index d9a7c3f963a5d673355cf58f099d376af6c413b4..90856f918e77ce8ffb91467905ebe397a57360e7 100644 (file)
@@ -2,6 +2,8 @@ obj-y += head.o
 
 head.o: reloc.S
 
-# NB. BOOT_TRAMPOLINE == 0x8c000
+BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\+BOOT_TRAMPOLINE[[:space:]]\+,,p' $(BASEDIR)/include/asm-x86/config.h)
 %.S: %.c
-       RELOC=0x8c000 $(MAKE) -f build32.mk $@
+       RELOC=$(BOOT_TRAMPOLINE) $(MAKE) -f build32.mk $@
+
+reloc.S: $(BASEDIR)/include/asm-x86/config.h
index a570d425242430f93981613e1efc8760e078dcff..01f7480b52e23b8746dc8e59b0e4e723d65a944b 100644 (file)
@@ -19,7 +19,9 @@ CFLAGS += -Werror -fno-builtin -msoft-float
        $(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-       $(LD) $(LDFLAGS_DIRECT) -N -Ttext 0x8c000 -o $@ $<
+       $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(RELOC) -o $@ $<
 
 %.o: %.c
        $(CC) $(CFLAGS) -c $< -o $@
+
+reloc.o: $(BASEDIR)/include/asm-x86/config.h
index 8c9b3c1d9e6814e465fe95683fd7427f0397e701..76539359c5e65be61c84e56d47f6fa52eb17afb8 100644 (file)
@@ -94,7 +94,7 @@
 /* Primary stack is restricted to 8kB by guard pages. */
 #define PRIMARY_STACK_SIZE 8192
 
-#define BOOT_TRAMPOLINE 0x8c000
+#define BOOT_TRAMPOLINE 0x88000
 #define bootsym_phys(sym)                                 \
     (((unsigned long)&(sym)-(unsigned long)&trampoline_start)+BOOT_TRAMPOLINE)
 #define bootsym(sym)                                      \